package com.library.admin.listener;

import com.library.admin.AdmLibrary;
import com.library.admin.form.AddBookForm;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Window;

public class ShowAddBookFormListener implements ClickListener {
	private static final long serialVersionUID = -291356060768196340L;

	public void buttonClick(ClickEvent event) {
		AdmLibrary libraryApplication = (AdmLibrary) event.getComponent().getApplication();
		Window addBookFormWindow = new Window("Ajouter un livre");
		addBookFormWindow.setWidth("30%");
		addBookFormWindow.setModal(true);
		addBookFormWindow.setResizable(false);
		addBookFormWindow.center();
		addBookFormWindow.addComponent(new AddBookForm());
		
		libraryApplication.getMainWindow().addWindow(addBookFormWindow);
		//libraryApplication.getMenu().addComponent(new AddBookForm());
	}
}
